﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Collections_Join
{
    static class CollectionsJoin
    {
        static public string MyJoin<T>(this ICollection<T> collection)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("[");

            foreach (var item in collection)
            {
                if (item != null)
                {
                    sb.Append(item + ", ");
                }
            }
            sb.Remove(sb.Length - 2, 2);
            sb.Append("]");

            return sb.ToString();
        }

        static void Main(string[] args)
        {
            
        }
    }
}
